/*********************************************************************
  Pick one up today in the adafruit shop!
  ------> http://www.adafruit.com/category/63_98
*********************************************************************/
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#if (SSD1306_LCDHEIGHT != 64)
#error("Height incorrect, please fix Adafruit_SSD1306.h!");
#endif

void setup()   {    
  Serial.begin(115200);
  Serial.println("Setup begin");
  
  setupDatalogger();
  
  // by default, we'll generate the high voltage from the 3.3v line internally! (neat!)
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3D (for the 128x64)
  // init done
  
  // Clear the buffer.
  display.clearDisplay();
  display.setTextSize(7);
  display.setTextColor(WHITE);
  display.setRotation(2);
  display.display();

  Serial.println("Setup end");
}

void loop() {
  Serial.println(Timestamp()); 
  display.clearDisplay();
  display.setCursor(0,0);
  display.setTextSize(1);
  display.print(String("Hello World"));
  display.println("");
  display.setTextSize(4);
  display.print(getTemp(),1);
  display.display();
  
  delay(3000);  
}


